'''
Created on 15.12.2010

@author: imagovrn
'''

from pygraph.classes.graph import graph

class GraphPresets(object):
    @classmethod
    def six_node(cls):
        """
        Function returns a graph for which all calculations are performed
        """
        result = graph()
        result.DIRECTED = False
        
        result.add_nodes([i + 1 for i in xrange(6)])
        
        result.add_edge((1, 2), 1)
        result.add_edge((1, 3), 3)
        result.add_edge((2, 4), 1)
        result.add_edge((2, 6), 3)
        result.add_edge((3, 4), 1)
        result.add_edge((3, 5), 1)
        result.add_edge((4, 5), 3)
        result.add_edge((5, 6), 1)
        
        return result
    
    @classmethod
    def nine_node(cls):
        result = graph()
        result.DIRECTED = False;
        
        result.add_nodes([i + 1 for i in xrange(9)])
        
        result.add_edge((1, 2), 3)
        result.add_edge((2, 3), 3)
        result.add_edge((2, 6), 1)
        result.add_edge((3, 4), 1)
        result.add_edge((4, 5), 2)
        result.add_edge((5, 6), 2)
        result.add_edge((5, 7), 1)
        result.add_edge((6, 7), 1)
        result.add_edge((7, 8), 3)
        result.add_edge((8, 9), 3)
        
        return result
